package com.thor.palmmall.dao.banlancebill;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.thor.commons.entity.UCN;
import com.thor.commons.jpa.entity.PEntity;

@Entity
@Table(name="tBanlanceBillDetail")
public class PBanlanceBillDetail extends PEntity {
  private static final long serialVersionUID = 7877019122937248417L;
  private PBanlanceBill bill;
  private String billNo;
  private UCN subject;
  private Date beginDate;//开始时间
  private Date endDate;//结束时间
//  private String lastPayDate;//最后缴款日期
  private BigDecimal payTotal;
  private BigDecimal payedTotal;
  private BigDecimal unpayedTotal;
  private boolean confirmed;//账款是否确认
  private String accId;//账款id
  
  @ManyToOne(cascade = {CascadeType.ALL })
  @JoinColumn(name = "billUuid", nullable = false)
  public PBanlanceBill getBill() {
    return bill;
  }
  public void setBill(PBanlanceBill bill) {
    this.bill = bill;
  }
  @Column(name = "billNo", nullable = false,length = 50)
  public String getBillNo() {
    return billNo;
  }
  public void setBillNo(String billNo) {
    this.billNo = billNo;
  }
  @Embedded
  @AttributeOverrides({ @AttributeOverride(name = "uuid", column = @Column(name = "subjectUuid", length = 38, nullable = true)),
          @AttributeOverride(name = "code", column = @Column(name = "subjectCode", length = 50, nullable = true)),
          @AttributeOverride(name = "name", column = @Column(name = "subjectName", length = 100)) })
  public UCN getSubject() {
    return subject;
  }
  public void setSubject(UCN subject) {
    this.subject = subject;
  }
  
  @Column(name = "beginDate")
  public Date getBeginDate() {
    return beginDate;
  }
  public void setBeginDate(Date beginDate) {
    this.beginDate = beginDate;
  }
  
  @Column(name = "endDate")
  public Date getEndDate() {
    return endDate;
  }
  public void setEndDate(Date endDate) {
    this.endDate = endDate;
  }
  @Column(name = "payTotal", precision = 14, scale = 2)
  public BigDecimal getPayTotal() {
    return payTotal;
  }
  public void setPayTotal(BigDecimal payTotal) {
    this.payTotal = payTotal;
  }
  
  @Column(name = "payedTotal", precision = 14, scale = 2)
  public BigDecimal getPayedTotal() {
    return payedTotal;
  }
  public void setPayedTotal(BigDecimal payedTotal) {
    this.payedTotal = payedTotal;
  }
  
  @Column(name = "unpayedTotal", precision = 14, scale = 2)
  public BigDecimal getUnpayedTotal() {
    return unpayedTotal;
  }
  public void setUnpayedTotal(BigDecimal unpayedTotal) {
    this.unpayedTotal = unpayedTotal;
  }
  
  @Column(name = "confirmed", nullable = false)
  public boolean getConfirmed() {
    return confirmed;
  }
  public void setConfirmed(boolean confirmed) {
    this.confirmed = confirmed;
  }
  
  @Column(name = "accId", nullable = false,length = 50)
  public String getAccId() {
    return accId;
  }
  public void setAccId(String accId) {
    this.accId = accId;
  }
  
  
}
